package top.yzhao.trackdatasystem.dao;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import top.yzhao.trackdatasystem.dto.UserDTO;

import java.util.List;

/**
 * User: zhaoyang
 * Date: 2020/3/13
 * Time: 14:44
 * Description: No Description
 */
@Repository
@Mapper
public interface UserDao {

    @Select("select * from User where username like concat(concat('%',#{query}),'%') limit #{current},#{pageSize}")
    public List<UserDTO> getUserList(@Param("query") String query,
                                     @Param("current") int current,
                                     @Param("pageSize") int pageSize);

    @Select("Select count(*) from User")
    public int getTotalUserList();
}
